<?php $this->renderPartial('//common/header'); ?>
<!-- CONTENT CONTAINER -->
<div class="container">
	<ul class="breadcrumb">
		<li><a href="<?php echo PIUrl::createUrl('/home/');?>"><?php echo translate("Trang chủ"); ?></a></li>
		<li><span><?php echo translate("Hình ảnh"); ?></span></li>
	</ul>
	<div class="content-container">
		<div class="page-photo">
			<h2 class="title title-bd title-upper text-center">
				<a href="javascript:void(0)" class="active"><?php echo translate("Hình ảnh hoạt động"); ?></a>
			</h2>
			<ul class="row" id="images">
				<?php  if(!empty($arrImages)){ ?>
					<?php foreach($arrImages as $row){ ?>
						<li class="col-md-4 col-sm-6">
							<div class="inner">
								<a href="<?php echo Yii::app()->baseUrl; ?>/upload/images/<?php echo $row['image'];?>" class="bwWrapper popupImage">
									<img src="<?php echo getImage($row->image, 338, 160, 1); ?>" class="photo" width="338" height="160"/>
								</a>
							</div>
						</li>
					<?php } ?>
					<div style="clear:both;"></div>
			</ul>
			<?php $this->widget('ext.yiinfinite-scroll.YiinfiniteScroller', array(
				'contentSelector' => '#images',
				'itemSelector' => 'li.col-md-4',
				'loadingText' => 'Loading...',
				'loadingImg' => Yii::app()->theme->baseUrl."/img/front/loading.GIF",
				'donetext' => '',
				'pages' => $pages,
			)); ?>
			
			<?php
				if(isset($_GET['page'])){
					if(ceil($pages->itemCount/$pages->pageSize) < $_GET['page']){
						throw new CHttpException(404,'No More results');
					}
				}
			?>
			
			<?php }else{ echo translate("<li class='col-md-4 col-sm-6'>Không tìm thấy hình ảnh!</li>"); } ?>
		</div>
	</div>
</div>

<!-- FULL BLOCK HÌNH ẢNH HOẠT ĐỘNG -->
<?php $this->widget("application.components.widgetImages"); ?>

<!-- FULL BLOCK HỖ TRỢ LIÊN KẾT -->
<?php $this->widget("application.components.widgetLinkSupport"); ?>

<div id="push"> </div>
</div>
<?php $this->renderPartial('//common/footer'); ?>

<script>
$(document).ready(function(){
	
	$('.popupImage').magnificPopup({
	  type: 'image',
	  gallery:{
		enabled:true
	  }
	});
});
</script>